import httpUtil  from '../libs/httpUtil'

export default {
  url: '/graphs/',
  list () {
    return httpUtil.fetch({
      url: this.url,
      method: 'get'
    });
  },
  fetchData (id) {
    return httpUtil.fetch({
      url: this.url + id,
      method: 'get'
    });
  },
  create (data) {
    return httpUtil.fetch({
      url: `${this.url}`,
      method: 'post',
      data
    });
  },
  update (data) {
    return httpUtil.fetch({
      url: this.url,
      method: 'put',
      data
    });
  },
  delete (id) {
    return httpUtil.fetch({
      url: `${this.url}/${id}`,
      method: 'delete'
    });
  }
}
